<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLableCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('lable_categories', function (Blueprint $table) {
            $table->id()->comment('标签分类表');
            $table->integer('pid')->default(0)->comment('上级id');
            $table->integer('system_admin_id')->comment('所属人id')->index();
            $table->string('name')->comment('分类名称');
            $table->integer('sort')->default(0)->comment('排序');
            $table->integer('type')->default(0)->comment('分类类型 0:标签分类，1:快捷短语分类');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('lable_categories');
    }
}
